SetValue - JSONArray

Note: This statement is not available in the Add Statement dialog box or the Statements pane.

Sets or adds a value to an index in a JSONArray.

Syntax

SetValue(Index, "Value")

Arguments

Argument Description
Index Index in the JSONArray. Indexes are zero based. If the index is greater than the size of the array, the value is added to the end of the array.
Value Value to set. Must be a string, integer, float, Boolean, null, JSONObject, or JSONArray. If a JSONObject or JSONArray is used, a copy is created and inserted into the JSONArray.

Supported objects

JSONArray

Example

jsonArray = JSONNewArray()

' Sets first index in JSONArray to -1

jsonArray.SetValue(0, -1)